# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip


platform :ios, '15.1'

prepare_react_native_project!
# use_frameworks need to be loaded before use_react_native! for now
use_frameworks!


target 'OnnxruntimeModuleExample' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],

#     :flipper_configuration => FlipperConfiguration.enabled,
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )


  ort_c_local_pod_path = ENV['ORT_C_LOCAL_POD_PATH']
  if ort_c_local_pod_path != nil
    print 'Using onnxruntime-c pod at ', ort_c_local_pod_path, "\n"
    pod 'onnxruntime-c', :path => ort_c_local_pod_path
  end
  pod 'onnxruntime-react-native', :path => '../node_modules/onnxruntime-react-native'

  inherit! :search_paths
  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
    )
  end
end
